home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1999 January / PC Plus Super CD No55a (PCP-147A-1-99) (Disc 1) (1998).iso / linux / developers / visualtcl / windows / vtcl / lib / compounds.tcl < prev    next >
Encoding:
Text File  |  1997-05-27  |  8.8 KB  |  101 lines

  1. ##############################################################################
  2. # $Id: compounds.tcl,v 1.4 1997/05/28 02:34:03 stewart Exp $
  3. #
  4. # compounds.tcl - bundled system compound widgets
  5. #
  6. # Copyright (C) 1996-1997 Stewart Allen
  7. #
  8. # This program is free software; you can redistribute it and/or
  9. # modify it under the terms of the GNU General Public License
  10. # as published by the Free Software Foundation; either version 2
  11. # of the License, or (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program; if not, write to the Free Software
  20. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  
  22. ##############################################################################
  23. #
  24.  
  25. set vTcl(syscmpd,list) "{Menu Bar} {Scrollable Text} {Scrollable Listbox} {Label and Entry} {Scrollable Canvas}"
  26.  
  27. set {vTcl(syscmpd:Menu Bar)} {{frame {-borderwidth 1 -height 30 -relief sunken -width 30} {pack {-anchor center -expand 0 -fill x -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top}} {} {} {{menubutton {-anchor w  -menu .top1.fra3.men4.m -padx 4 -pady 3 -text File -width 4} {pack {-anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side left}} {} {} {{menu { -tearoff 0} {{} {}} {} {{command {-accelerator Ctrl-O -label Open}} {command {-accelerator Ctrl-W -label Close}}} {} .01.02 {}} } .01 {}} {menubutton {-anchor w  -menu .top1.fra3.men5.01 -padx 4 -pady 3 -text Edit -width 4} {pack {-anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side left}} {} {} {{menu { -tearoff 0} {{} {}} {} {} {} .03.04 {}} } .03 {}} {menubutton {-anchor w  -menu .top1.fra3.men6.01 -padx 4 -pady 3 -text Help -width 4} {pack {-anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side right}} {} {} {{menu { -tearoff 0} {{} {}} {} {} {} .05.06 {}} } .05 {}} } {} {}} {{.top1.fra3.men4.m .01.02} {.top1.fra3.men4 .01} {.top1.fra3.men5.01 .03.04} {.top1.fra3.men5 .03} {.top1.fra3.men6.01 .05.06} {.top1.fra3.men6 .05} {.top1.fra3 }}}
  28.  
  29. set {vTcl(syscmpd:Label and Entry)} {{frame {-borderwidth 1 -height 30 -relief raised -width 30} {place {-x 10 -relx 0 -y 10 -rely 0 -width 245 -relwidth {} -height 25 -relheight {} -anchor nw -bordermode ignore}} {} {} {{label {-anchor w  -relief groove -text label} {pack {-anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 2 -pady 2 -side left}} {} {} {} .01 {}} {entry {-cursor {}  -highlightthickness 0} {pack {-anchor center -expand 1 -fill x -ipadx 0 -ipady 0 -padx 2 -pady 2 -side right}} {} {} {} .02 {}} } {} {}} {{.top1.fra7.lab8 .01} {.top1.fra7.ent9 .02} {.top1.fra7 }}}
  30.  
  31. set {vTcl(syscmpd:Scrollable Listbox)} {{frame {-borderwidth 1 -height 30 -relief raised -width 30} {place {-x 5 -y 5 -width 135 -height 125 -anchor nw -bordermode ignore}} {} {} {{listbox {-font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -xscrollcommand {.top16.fra17.scr19 set} -yscrollcommand {.top16.fra17.scr20 set}} {grid {-column 0 -row 0 -columnspan 1 -rowspan 1 -sticky nesw}} {} {} {} .01 {} {} {}} {scrollbar {-borderwidth 1 -command {.top16.fra17.lis18 xview} -orient horiz -width 10} {grid {-column 0 -row 1 -columnspan 1 -rowspan 1 -sticky ew}} {} {} {} .02 {} {} {}} {scrollbar {-borderwidth 1 -command {.top16.fra17.lis18 yview} -orient vert -width 10} {grid {-column 1 -row 0 -columnspan 1 -rowspan 1 -sticky ns}} {} {} {} .03 {} {} {}} } {} {} {{columnconf 0 -weight 1} {rowconf 0 -weight 1}} {}} {{.top16.fra17.lis18 .01} {.top16.fra17.scr19 .02} {.top16.fra17.scr20 .03} {.top16.fra17 }}}
  32.  
  33. set {vTcl(syscmpd:Scrollable Text)} {{frame {-borderwidth 1 -height 30 -relief raised -width 30} {place {-x 5 -y 5 -width 143 -height 126 -anchor nw}} {} {} {{scrollbar {-borderwidth 1 -command {.top16.cpd27.03 xview} -orient horiz -width 10} {grid {-column 0 -row 1 -columnspan 1 -rowspan 1 -sticky ew}} {} {} {} .01 {} {} {}} {scrollbar {-borderwidth 1 -command {.top16.cpd27.03 yview} -orient vert -width 10} {grid {-column 1 -row 0 -columnspan 1 -rowspan 1 -sticky ns}} {} {} {} .02 {} {} {}} {text {-font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -height 1 -width 8 -xscrollcommand {.top16.cpd27.01 set} -yscrollcommand {.top16.cpd27.02 set}} {grid {-column 0 -row 0 -columnspan 1 -rowspan 1 -sticky nesw}} {} {} {} .03 {} {} {}} } {} {} {{columnconf 0 -weight 1} {rowconf 0 -weight 1}} {}} {{.top16.cpd27.01 .01} {.top16.cpd27.02 .02} {.top16.cpd27.03 .03} {.top16.cpd27 }}}
  34.  
  35. set {vTcl(syscmpd:Scrollable Canvas)} {{frame {-borderwidth 1 -height 30 -relief raised -width 30} {place {-x 5 -y 5 -width 143 -height 126 -anchor nw}} {} {} {{scrollbar {-borderwidth 1 -command {.top16.fra29.can30 xview} -orient horiz -width 10} {grid {-column 0 -row 1 -columnspan 1 -rowspan 1 -sticky ew}} {} {} {} .01 {} {} {}} {scrollbar {-borderwidth 1 -command {.top16.fra29.can30 yview} -orient vert -width 10} {grid {-column 1 -row 0 -columnspan 1 -rowspan 1 -sticky ns}} {} {} {} .02 {} {} {}} {canvas {-borderwidth 2 -height 100 -relief ridge -width 100 -xscrollcommand {.top16.fra29.01 set} -yscrollcommand {.top16.fra29.02 set}} {grid {-column 0 -row 0 -columnspan 1 -rowspan 1 -sticky nesw}} {} {} {} .03 {} {} {}} } {} {} {{columnconf 0 -weight 1} {rowconf 0 -weight 1}} {}} {{.top16.fra29.01 .01} {.top16.fra29.02 .02} {.top16.fra29.can30 .03} {.top16.fra29 }}}
  36.  
  37.  
  38. ##############################################################################
  39. #
  40. # panelcomp.tcl - panel widgets
  41. #
  42. # Copyright (C) 1997 Carlos Pantano
  43. #
  44. # This program is free software; you can redistribute it and/or
  45. # modify it under the terms of the GNU General Public License
  46. # as published by the Free Software Foundation; either version 2
  47. # of the License, or (at your option) any later version.
  48. #
  49. # This program is distributed in the hope that it will be useful,
  50. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  51. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  52. # GNU General Public License for more details.
  53. #
  54. # You should have received a copy of the GNU General Public License
  55. # along with this program; if not, write to the Free Software
  56. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  57.  
  58. ##############################################################################
  59. #
  60.  
  61. lappend vTcl(syscmpd,list) {Split Vertical Panel} {Split Horizontal Panel}
  62.  
  63. set {vTcl(syscmpd:Split Vertical Panel)} {{frame {-background #000000 -width 200 -height 100} {pack {-expand 1 -fill both -side top}} {} {} {{frame {-background #9900991B99FE} {place {-x 0 -y 0 -relwidth 1 -height -1 -relheight 0.6595 -anchor nw -bordermode ignore}} {} {} {} .01 {} {} {
  64. } {}} {frame {-background #9900991B99FE} {place {-x 0 -y 0 -rely 1 -relwidth 1 -height -1 -relheight 0.3405 -anchor sw -bordermode ignore}} {} {} {} .02 {} {} {} {}} {frame {-background #ff0000 -borderwidth 2 -relief raised} {place {-x 0 -relx 0.9 -y 0 -rely 0.6595 -width 10 -height 10 -anchor e -bordermode ignore}} {{<B1-Motion> {
  65.     set root \[ split %W . \]
  66.     set nb \[ llength \$root \]
  67.     incr nb -1
  68.     set root \[ lreplace \$root \$nb \$nb \]
  69.     set root \[ join \$root . \]
  70.     set height \[ winfo height \$root \].0
  71.     
  72.     set val \[ expr (%Y - \[winfo rooty \$root\]) /\$height \]
  73.  
  74.     if { \$val >= 0 && \$val <= 1.0 } {
  75.     
  76.         place \$root.01 -relheight \$val
  77.         place \$root.03 -rely \$val
  78.         place \$root.02 -relheight \[ expr 1.0 - \$val \]
  79.     }
  80.     }}} {} {} .03 {} {} {} {}} } {} {} {} {} panel} {{.panel.top .01} {.panel.bottom .02} {.panel.handle .03} {.panel }}}
  81.  
  82.  
  83. set {vTcl(syscmpd:Split Horizontal Panel)} {{frame {-background #000000 -width 200 -height 100} {pack {-expand 1 -fill both -side top}} {} {} {{frame {-background #9900991B99FE} {place {-x 0 -y 0 -relheight 1 -width -1 -relwidth 0.6595 -anchor nw -bordermode ignore}} {} {} {} .01 {} {} 
  84. {} {}} {frame {-background #9900991B99FE} {place {-x 0 -y 0 -relx 1 -relheight 1 -width -1 -relwidth 0.3405 -anchor ne -bordermode ignore}} {} {} {} .02 {} {} {} {}} {frame {-background #ff0000 -borderwidth 2 -relief raised} {place {-y 0 -rely 0.9 -x 0 -relx 0.6595 -width 10 -height 10 -anchor s -bordermode ignore}} {{<B1-Motion> {
  85.     set root \[ split %W . \]
  86.     set nb \[ llength \$root \]
  87.     incr nb -1
  88.     set root \[ lreplace \$root \$nb \$nb \]
  89.     set root \[ join \$root . \]
  90.     set width \[ winfo width \$root \].0
  91.     
  92.     set val \[ expr (%X - \[winfo rootx \$root\]) /\$width \]
  93.  
  94.     if { \$val >= 0 && \$val <= 1.0 } {
  95.     
  96.         place \$root.01 -relwidth \$val
  97.         place \$root.03 -relx \$val
  98.         place \$root.02 -relwidth \[ expr 1.0 - \$val \]
  99.     }
  100.     }}} {} {} .03 {} {} {} {}} } {} {} {} {} panel} {{.panel.top .01} {.panel.bottom .02} {.panel.handle .03} {.panel }}}
  101.